package com.study.cloud;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author wangwancheng
 * @create 2025/7/18 22:32
 */
public class ChatClientHandler extends SimpleChannelInboundHandler<String> {
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, String o) throws Exception {
        System.out.println(sdf.format(new Date()) + " 收到服务端消息:"+o.trim());
    }
}
